<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>flex布局</title>
</head>

<style>
  body {
    margin:0;
  }

  .container {
    display: flex;
    height: 100vh;
  }

  .left {
    width: 100px;
    background-color: darkblue;
  }

  .middle {
    flex: 1;
    background-color: darkgray;
  }

  .right {
    width: 100px;
    background-color: darkgreen;
  }
</style>

<body>
  <div class="container">
    <div class="left"></div>
    <div class="middle"></div>
    <div class="right"></div>
  </div>
</body>
</html>